package singlefactory;

import staticfactory.WhiteHuman;

/**
 * @author gaopeng
 * @date 2019/12/7 6:39 下午
 */
public class Client {

    public static void main(String[] args) {
        int count = 10;
        for (int i = 0; i < count; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    int num=5;
                    for (int j = 0; j < num; j++) {
                        Single singleBean = (Single)SingleFactory.createSingleBean(Single.class);
                        singleBean.say(Thread.currentThread().getName());
                        WhiteHuman white = (WhiteHuman) SingleFactory.createSingleBean(WhiteHuman.class);
                        white.getColor();
                    }
                }
            }).start();
        }
    }
}
